// 导入封装的请求实例
import request from '@/utils/request'
// 请求方法
// 1.获取列表数据
export const getStudentList = params => {
  return request({
    url: '/admin/class/student',
    method: 'get',
    params
  })
}
// 2.获取下拉框归属学科的接口--刷新页面就调用,所以在created里面调用
export const getSubjectTree = () => {
  return request({
    url: '/admin/subject/tree',
    method: 'get'
  })
}
// 3.获取下拉框归属班级的接口
export const getSubjectClass = params => {
  return request({
    url: '/admin/class/class',
    method: 'get',
    params
  })
}
// 4.查询单个
export const getStudentInfo = id => {
  return request({
    url: `/admin/class/student/${id}`,
    method: 'get'

  })
}

// 5.添加
export const addStudent = data => {
  return request({
    url: '/admin/class/student',
    method: 'post',
    data
  })
}
// 6.修改
export const updateStudent = data => {
  return request({
    url: `/admin/class/student/${data.id}`,
    method: 'put',
    data

  })
}
// 7.删除
export const delStudent = data => {
  return request({
    url: `/admin/class/student`,
    method: 'delete',
    data
  })
}
// 8.批量删除
export const multiDelete = data => {
  return request({
    url: `/admin/class/student`,
    method: 'delete',
    data
  })
}
// 9.批量启用Enable
export const multiEnable = data => {
  return request({
    url: `/admin/class/studentChangeStatus`,
    method: 'put',
    data
  })
}
// 10.批量禁用Disable
export const multiDisable = data => {
  return request({
    url: `/admin/class/studentChangeStatus`,
    method: 'put',
    data
  })
}
// 11.导入excel
export const multiExport = data => {
  return request({
    url: '/admin/class/student/import',
    method: 'post',
    data
  })
}
